<%@ include file="../common/top.jsp" %>


<div id="Catalog">
    <c:if test="${sessionScope.msg!=null}">
        <h3><font color="red">${sessionScope.msg}</font></h3>
    </c:if>
    <form action="updateOrder" method="post">

    <h2>Delivery Address</h2>

    <table>
        <tr>
            <td id="AddressInfo">AddressInfo</td>
            <td id="DetailInfo">DetailInfo</td>
        </tr>
    </table>

    <table id="AddressTable">
        <tr>
            <td><b>Receiver FirstName</b></td>
            <td>
               <input type="text" name="receiverFirstName">
            </td>
        </tr>
        <tr>
            <td><b>Receiver LastName</b></td>
            <td>
                <input type="text" name="receiverLastName">
            </td>
        </tr>
        <tr>
            <td><b>ShipTo Address1</b></td>
            <td>
                <input type="text" name="shipToAddress1">
            </td>
        </tr>
        <tr>
            <td><b>ShipTo Address2</b></td>
            <td>
                <input type="text" name="shipToAddress2">
            </td>
        </tr>
        <tr>
            <td><b>Notes</b></td>
            <td>
                <input type="text" name="notes">
            </td>
        </tr>
    </table>

        <table id="DetailTable" HIDDEN="hidden">
            <tr>
                <td><b>Phone Number</b></td>
                <td>
                    <input type="text" name="phoneNumber">
                </td>
            </tr>
            <tr>
                <td><b>Bill Country</b></td>
                <td>
                    <input type="text" name="billCountry">
                </td>
            </tr>
            <tr>
                <td><b>Ship Time</b></td>
                <td>
                    <input type="text" name="shipTime">
                </td>
            </tr>
            <tr>
                <td><b>Zip</b></td>
                <td>
                    <input type="text" name="zip">
                </td>
            </tr>
            <tr>
                <td><b>CreditCard</b></td>
                <td>
                    <input type="text" name="creditCard">
                </td>
            </tr>
        </table>

    <h2>Cart List</h2>
    <table>
        <tr>
            <th><b>Item ID</b></th>
            <th><b>Product ID</b></th>
            <th><b>Description</b></th>
            <th><b>In Stock?</b></th>
            <th><b>Quantity</b></th>
            <th><b>List Price</b></th>
            <th><b>Total Cost</b></th>
        </tr>

        <c:forEach var="cartItem" items="${sessionScope.cart.allCartItems}">
            <tr>
                <td>
                    <a href="itemForm?itemId=${cartItem.item.itemId}">${cartItem.item.itemId}</a>
                </td>
                <td>${cartItem.item.product.productId}</td>
                <td>${cartItem.item.attribute1} ${cartItem.item.attribute2}
                        ${cartItem.item.attribute3} ${cartItem.item.attribute4}
                        ${cartItem.item.attribute5} ${cartItem.item.product.name}</td>
                <td>${cartItem.inStock}</td>

                <td>
                    ${cartItem.quantity}
                </td>
                <td><fmt:formatNumber value="${cartItem.item.listPrice}"
                                      pattern="$#,##0.00" /></td>
                <td><fmt:formatNumber value="${cartItem.total}"
                                      pattern="$#,##0.00" /></td>
            </tr>
        </c:forEach>
    </table>

        <table>
            <tr>
                <td><b>TOTAL COST:</b></td>
                <td><fmt:formatNumber value="${sessionScope.cart.subTotal}" pattern="$#,##0.00" /></td>
                <td><input type="submit" value="ORDER NOW!"></td>
            </tr>
        </table>

    </form>
</div>

<script src="./js/Order/orderSelect.js"></script>

<%@ include file="../common/bottom.jsp" %>
